package com.hfzy.ihk.web.freeswitchManage.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * 呼叫来源应用
 * @author wws
 */
public enum ClientType implements CustomEnumType {

    IHK("IHK", "合富置业用户使用freeswitch用户类型"),
    BL("BL", "爱家使用freeswitch用户类型");


    private ClientType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;
    @Override
    public String getValue() {
        return value;
    }
    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, ClientType> map = new HashMap<>();
    static {
        for (ClientType value : ClientType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static ClientType fromValue(String value) {
        ClientType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + ClientType.class + "." + value);
        }
    }

    public static Boolean existClientType(String value){
        if(map.get(value)!=null){
            return true;
        }
        else
        {
            return false;
        }

    }

}
